// @ts-nocheck
import axios from "axios";
import http from "../../utils/Axios";

export interface IEventList {
  categoryCompleteName: string;
  code: string;
  name: string;
  parentCode: string;
  parentName: string;
  sorting: number;
  categoryChild?: IEventList[];
}




// 服务项目下拉
export async function serviceItem(param:string) {
  return http<IEventList[]>(
    "get",
    `/app/keeper-special/community/getServeProject?serveType=${param}`,
    {}
  );
}

interface IUploadImage {
  file: File;
}

export async function upLoadImage(prams: IUploadImage) {
  const formData = new FormData();
  formData.append("file", prams.file);

  return await axios.post("/api/seh-resource/attach/uploads", formData, {
    headers: {
      "Content-type": "multipart/form-data",
    },
  });
}

interface IPutEventReport {
  questiontitle: string; // 事件名称
  eventType: string; //事件类型
  desc: string; //描述
  detailedAddress: string; //详细地址
  city: string; //城市 区
  street: string; //街道
  county: string; //社区
  hadress: string; //发生地址
  longitude: number; // 经度
  latitude: number; // 纬度
  fileFront: string[];
}

export async function putEventReport(parmas: IPutEventReport) {}



export interface IRequestEventReport {
  processDefId: string;
  formCommitData: string;
}

// 社区服务上传
export async function putServiceEventReportByFromData(parmas: IRequestEventReport) {
  return http(
    "post",
    // "/api/seh-workflow/manager/startProcessInstanceWithFormData",
    "/app/keeper-special/community/communityServeEventReport",
    parmas
  );
}


